package com.ly.dingtalk.service.user;

import com.aliyun.dingtalkcontact_1_0.models.ListEmpLeaveRecordsRequest;
import com.aliyun.dingtalkcontact_1_0.models.ListEmpLeaveRecordsResponse;
import com.dingtalk.api.request.OapiInactiveUserV2GetRequest;
import com.dingtalk.api.request.OapiUserGetAdminScopeRequest;
import com.dingtalk.api.request.OapiUserGetbyunionidRequest;
import com.dingtalk.api.request.OapiUserListadminRequest;
import com.dingtalk.api.request.OapiUserListsimpleRequest;
import com.dingtalk.api.request.OapiV2UserCreateRequest;
import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.request.OapiV2UserUpdateRequest;
import com.dingtalk.api.response.OapiInactiveUserV2GetResponse;
import com.dingtalk.api.response.OapiUserCountResponse;
import com.dingtalk.api.response.OapiUserGetAdminScopeResponse;
import com.dingtalk.api.response.OapiUserGetbyunionidResponse;
import com.dingtalk.api.response.OapiUserListadminResponse;
import com.dingtalk.api.response.OapiUserListidResponse;
import com.dingtalk.api.response.OapiUserListsimpleResponse;
import com.dingtalk.api.response.OapiV2UserCreateResponse;
import com.dingtalk.api.response.OapiV2UserDeleteResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import com.dingtalk.api.response.OapiV2UserUpdateResponse;

import lombok.NonNull;

public interface IDingUserNewHandler {
    
    /**
     * https://open.dingtalk.com/document/orgapp/user-information-creation
     * @Description: 创建用户
     */
    OapiV2UserCreateResponse createUser(OapiV2UserCreateRequest user);
    
    /**
     * https://open.dingtalk.com/document/orgapp/user-information-update
     * @Description: 更新用户
     */
    OapiV2UserUpdateResponse updateUserById(OapiV2UserUpdateRequest user);
    
    /**
     * https://open.dingtalk.com/document/orgapp/delete-a-user
     * @Description: 删除用户
     */
    OapiV2UserDeleteResponse deleteUserById(String userId);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-user-details
     * @Description: 查询用户详情
     */
    OapiV2UserGetResponse getUserById(String useId);
    
    
    /**
     * https://open.dingtalk.com/document/orgapp/queries-the-simple-information-of-a-department-user
     * @Description: 本接口只支持获取员工的userId和name两个字段信息
     */
    OapiUserListsimpleResponse listsimple(OapiUserListsimpleRequest useId);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-the-list-of-department-userids
     * @Description: 获取部门用户userid列表
     */
    OapiUserListidResponse listid(Long deptId);
    
    
    /**
     * https://open.dingtalk.com/document/orgapp/queries-the-complete-information-of-a-department-user
     * @Description: 获取部门用户userid列表
     */
    OapiV2UserListResponse list(OapiV2UserListRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/obtain-the-number-of-employees-v2#title-1o3-hft-5pr
     * @Description: 获取员工人数
     */
    OapiUserCountResponse count(Boolean onlyActive);
    
    /**
     * https://open.dingtalk.com/document/orgapp/queries-the-inactive-users-or-active-users-under-an-enterprise
     * @Description: 获取未登录钉钉的员工列表
     */
    OapiInactiveUserV2GetResponse getInactive(OapiInactiveUserV2GetRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-users-by-phone-number
     * @Description: 根据手机号查询企业账号用户
     */
    OapiV2UserGetbymobileResponse getbymobile(OapiV2UserGetbymobileRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-a-user-by-the-union-id
     * @Description: 根据unionid获取用户userid
     */
    OapiUserGetbyunionidResponse getbyunionid(OapiUserGetbyunionidRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-the-administrator-list
     * @Description: 获取管理员列表
     */
    OapiUserListadminResponse listadmin(OapiUserListadminRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-permissions-of-the-administrator-address-book
     * @Description: 获取管理员通讯录权限范围
     */
    OapiUserGetAdminScopeResponse getAdminScope(OapiUserGetAdminScopeRequest req);
    
    /**
     * https://open.dingtalk.com/document/orgapp/query-the-details-of-employees-who-have-left-office
     * @Description: 查询离职记录列表
     */
    ListEmpLeaveRecordsResponse empLeaveRecords(ListEmpLeaveRecordsRequest req);
    
    /**
     * 通过免登码获取用户信息
     * (https://open.dingtalk.com/document/isvapp/obtain-the-userid-of-a-user-by-using-the-log-free)
     * @param authCode 免登录授权码,此授权码五分钟内有效，且只能使用一次
     * @return 用户基本信息，包含unionId和userId
     */
    OapiV2UserGetuserinfoResponse.UserGetByCodeResponse findUserByLoginAuthCode(@NonNull  String authCode);
    
    
}
